home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr57 / nwnt.zip / NWNT.EXE / OEMNADNX.INF < prev    next >
INI File  |  1993-04-22  |  32KB  |  1,109 lines

  1. ;***********************************************************************
  2. ;
  3. ; OEMNADNX.INF
  4. ;
  5. ;       Novell ODI NE2000 network card SETUP INF file.
  6. ;
  7. ;***********************************************************************
  8.  
  9. ;-----------------------------------------------------------------------
  10. ; OPTION TYPE
  11. ; -----------
  12. ; This identifies the Option type we are dealing with.  The different
  13. ; possible types are:
  14. ;
  15. ; COMPUTER, DISPLAY, MOUSE, KEYBOARD, LAYOUT, SCSI, PRINTER, ...
  16. ;
  17. ;  Types specific to networking:
  18. ;
  19. ; NetAdapter,        a netcard / adapter combination or just a netcard
  20. ; NetDriver,         just a netcard driver
  21. ; NetTransport,      a complete NDIS-compliant TDI transport stack
  22. ; NetService,        an NT networking service
  23. ; NetWork,           a complete network ensemble.
  24. ; NetProvider        a complete network which supports NT MPR protocol
  25. ;-----------------------------------------------------------------------
  26.  
  27. [Identification]
  28.     OptionType = NetAdapter
  29.  
  30. ;-----------------------------------------------------------------------
  31. ; PlatformsSupported
  32. ; ------------------
  33. ; This identifies the platforms supported by the adapter card.
  34. ; Possible types are:
  35. ;
  36. ; ISA, EISA and MCA
  37. ;-----------------------------------------------------------------------
  38.  
  39. [PlatformsSupported]
  40.     ISA
  41.     EISA
  42.     "Jazz-Internal Bus"
  43.  
  44. ;-----------------------------------------------------------------------
  45. ; OPTION LIST
  46. ; -----------
  47. ; This section lists the OEM Option key names.  These keys are locale
  48. ; independent and used to represent the option in a locale independent
  49. ; manner.
  50. ;
  51. ;-----------------------------------------------------------------------
  52.  
  53. [Options]
  54.     ODI_NE2000
  55.  
  56. [LanguagesSupported]
  57.     ENG
  58.  
  59. [OptionsTextENG]
  60.     ODI_NE2000     = "ODI Novell NE2000 Adapter"
  61.  
  62. ;***********************************************************************
  63. ; CONSTANTS FOR USING DIALOGS
  64. ;***********************************************************************
  65. [FileConstants]
  66. ;
  67. ;  File names, etc.
  68. ;
  69. UtilityInf      = "UTILITY.INF"
  70. ParamInf        = "NCPARAM.INF"
  71. subroutineinf   = "SUBROUTN.INF"
  72. Exit_Code       = 0
  73. ;ShellCode       = 0
  74.  
  75. ;
  76. ; EventLog Message File
  77. ;
  78. NetEventDLL     = "%SystemRoot%\System32\netevent.dll"
  79. IoLogMsgDLL     = "%SystemRoot%\System32\IoLogMsg.dll"
  80.  
  81. ; Product Info
  82. ;
  83. Manufacturer    = "Novell"
  84. ProductMajorVersion     = "0"
  85. ProductMinorVersion     = "9"
  86. ProductVersion  = $(ProductMajorVersion)"."$(ProductMinorVersion)
  87. ;
  88. ; Hardware
  89. ;
  90. DriverName                   = "ODILOAD"
  91. OdiModules             = "ODI_Modules"
  92. ProductHardwareName          = "NE2000"
  93. ProductHardwareODI_NE2000Title   = "ODI Novell NE2000 Adapter"
  94. NetRuleHardwareType          = "nwNe2000 nwAdapter"
  95. NetRuleHardwareBindForm      = " yes yes container"
  96. ;
  97. ; Registry Key
  98. ;
  99. ProductKeyName  = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(DriverName)"\CurrentVersion"
  100. ParamKeyName    = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
  101.  
  102. ;
  103. ;  Dialog Parameters
  104. ;
  105. IRQList   = ^(IRQChoices, 1)
  106. IRQValues = ^(IRQChoices, 2)
  107. IOBaseAddrHexList = ^(IOBaseAddrChoices, 1)
  108. IOBaseAddrDecList = ^(IOBaseAddrChoices, 2)
  109. IOBaseAddrNwList  = ^(IOBaseAddrChoices, 3)
  110.  
  111. [IRQChoices]
  112. IRQ_0 = "2",2
  113. IRQ_1 = "3",3
  114. IRQ_2 = "4",4
  115. IRQ_3 = "5",5
  116.  
  117. [IOBaseAddrChoices]
  118. IOBase_1  = "0x300",768,300
  119. IOBase_2  = "0x320",800,320
  120. IOBase_3  = "0x340",832,340
  121. IOBase_4  = "0x360",864,360
  122.  
  123. [DialogConstantsENG]
  124. Help        = "&Help"
  125. Exit        = "Cancel"
  126. OK          = "OK"
  127. HelpContext = ""
  128. Continue    = "Continue"
  129. Cancel      = "Cancel"
  130.  
  131. [FileDependentDlgENG]
  132. DlgType = "RadioCombination"
  133. DlgTemplate = "NE2000"
  134. Caption = $(FunctionTitle)
  135. Label1 = "&IRQ Level:"
  136. Label2 = "I/O &Port Address:"
  137. Combo1List = $(IRQList)
  138. Combo1Out  = $(IRQValue)
  139. Combo2List = $(IOBaseAddrHexList)
  140. Combo2Out  = $(IOBaseAddress)
  141. ComboListItemsIn  = {Combo1List, Combo2List}
  142. ComboListItemsOut = {Combo1Out, Combo2Out}
  143. EditTextIn = ""
  144. EditTextLim = ""
  145. CBOptionsGreyed = {}
  146. NotifyFields = {NO, NO}
  147. HelpContext = $(!IDH_DB_OEMNADN2_INS)
  148.  
  149. [FileConstantsENG]
  150. ProCaption   = "Netware for Windows NT Setup"
  151. ProCancel    = "Cancel"
  152. ProCancelMsg = "Netware for Windows NT is not correctly installed.  "+
  153.                "Are you sure you want to cancel copying files?"
  154. ProCancelCap = "Network Setup Message"
  155. ProText1     = "Copying:"
  156. ProText2     = "To:"
  157. FunctionTitle   = "Novell NE2000 Network Card Setup"
  158. ProductSoftwareDescription      = "ODI Novell NE2000 Adapter Driver"
  159. ProductHardwareODI_NE2000Description        = "ODI Novell NE2000 Adapter"
  160.  
  161. [GeneralConstants]
  162. ;
  163. ;  Program flow control variables.
  164. ;
  165. from      = ""
  166. to        = ""
  167. ;
  168. ;  Return codes; Exit_Code is set to one of these
  169. ;
  170. ExitCodeOk     = 0
  171. ExitCodeCancel = 1
  172. ExitCodeFatal  = 2
  173.  
  174. KeyNull         = ""
  175. MAXIMUM_ALLOWED   = 33554432
  176. RegistryErrorIndex = NO_ERROR
  177. KeyProduct      = ""
  178. KeyParameters   = ""
  179.  
  180. TRUE            = 1
  181. FALSE           = 0
  182. NoTitle            = 0
  183.  
  184. ExitState   = "Active"
  185. OldVersionExisted = $(FALSE)
  186.  
  187. DriverPath      = $(!STF_NTPATH)\drivers
  188.  
  189. [date]
  190.     ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
  191.     ; Minute, Second }
  192.     Now = {} ? $(!LIBHANDLE) GetSystemDate
  193.  
  194.  
  195. ;---------------------------------------------------------------------------
  196. ; 1. Identify
  197. ;
  198. ; DESCRIPTION:   To verify that this INF deals with the same type of options
  199. ;                as we are choosing currently.
  200. ;
  201. ; INPUT:         None
  202. ;
  203. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL
  204. ;                $($R1): Option Type (COMPUTER ...)
  205. ;                $($R2): Diskette description
  206. ;---------------------------------------------------------------------------
  207.  
  208. [Identify]
  209.     ;
  210.     ;
  211.     read-syms Identification
  212.  
  213.     set Status     = STATUS_SUCCESSFUL
  214.     set Identifier = $(OptionType)
  215.     set Media      = #("Source Media Descriptions", 1, 1)
  216.  
  217.     Return $(Status) $(Identifier) $(Media)
  218.  
  219. ;------------------------------------------------------------------------
  220. ; 2. ReturnOptions:
  221. ;
  222. ; DESCRIPTION:   To return the option list supported by this INF and the
  223. ;                localised text list representing the options.
  224. ;
  225. ;
  226. ; INPUT:         $($0):  Language used. ( ENG | FRN | ... )
  227. ;
  228. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL |
  229. ;                                STATUS_NOLANGUAGE
  230. ;                                STATUS_FAILED
  231. ;                                STATUS_NOTSUPPORTED
  232. ;
  233. ;                $($R1): Option List
  234. ;                $($R2): Option Text List
  235. ;------------------------------------------------------------------------
  236.  
  237. [ReturnOptions]
  238.     ;
  239.     ;
  240.     set Status        = STATUS_FAILED
  241.     set OptionList     = {}
  242.     set OptionTextList = {}
  243.  
  244.     ;
  245.     ; Check if the language requested is supported
  246.     ;
  247.     set LanguageList = ^(LanguagesSupported, 1)
  248.     Ifcontains(i) $($0) in $(LanguageList)
  249.         ;
  250.         ; Check if the platforms requested is supported
  251.         ;
  252.         ifstr(i) $($1) == ""
  253.            goto returnoptions
  254.         endif
  255.  
  256.         set PlatformList = ^(PlatformsSupported, 1)
  257.         Ifcontains(i) $($1) in $(PlatformList)
  258.            goto returnoptions
  259.         else
  260.            set Status = STATUS_NOTSUPPORTED
  261.            goto finish_ReturnOptions
  262.         endif
  263.     else
  264.         set Status = STATUS_NOLANGUAGE
  265.         goto finish_ReturnOptions
  266.     endif
  267.  
  268.     ;
  269.     ; form a list of all the options and another of the text representing
  270.     ;
  271.  
  272. returnoptions = +
  273.     set OptionList     = ^(Options, 1)
  274.     set OptionTextList = ^(OptionsText$($0), 1)
  275.     set Status         = STATUS_SUCCESSFUL
  276.  
  277. finish_ReturnOptions = +
  278.     Return $(Status) $(OptionList) $(OptionTextList)
  279.  
  280. ;----------InstallOption-------------------------------------------------
  281. ;
  282. ; InstallOption:
  283. ;
  284. ;      This section is shelled to by main installation processing
  285. ;      or by NCPASHEL.INF during reconfig, removal, update, etc.
  286. ;
  287. ;
  288. ; FUNCTION:  To copy files representing Options
  289. ;            To configure the installed option
  290. ;            To update the registry for the installed option
  291. ;
  292. ; INPUT:     $($0):  Language to use
  293. ;            $($1):  OptionID to install
  294. ;            $($2):  SourceDirectory
  295. ;            $($3):  AddCopy  (YES | NO)
  296. ;            $($4):  DoCopy   (YES | NO)
  297. ;            $($5):  DoConfig (YES | NO)
  298. ;
  299. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  300. ;                            STATUS_NOLANGUAGE |
  301. ;                            STATUS_USERCANCEL |
  302. ;                            STATUS_FAILED
  303. ;
  304. ;------------------------------------------------------------------------
  305. [InstallOption]
  306.     ;
  307.     ; extract parameters
  308.     ;
  309.     set Option   = $($1)
  310.     set SrcDir   = $($2)
  311.     set AddCopy  = $($3)
  312.     set DoCopy   = $($4)
  313.     set DoConfig = $($5)
  314.  
  315.     ;
  316.     ; Check if the language requested is supported
  317.     ;
  318.     set LanguageList = ^(LanguagesSupported, 1)
  319.     Ifcontains(i) $($0) NOT-IN $(LanguageList)
  320.         Return STATUS_NOLANGUAGE
  321.     endif
  322.     Debug-Output "OEMNADTK.INF: STF_CWDIR is: "$(!STF_CWDIR)
  323.  
  324.     ; define all the constants
  325.  
  326.     set-subst LF = "\n"
  327.  
  328.     read-syms GeneralConstants
  329.     read-syms FileConstants
  330.  
  331.     read-syms DialogConstants$(!STF_LANGUAGE)
  332.     ifstr(i) $(!NTN_Origination) == "NCPA"
  333.         set Continue = "OK"
  334.     endif
  335.     read-syms FileConstants$(!STF_LANGUAGE)
  336.  
  337.     detect date
  338.  
  339.     set-title  $(FunctionTitle)
  340.  
  341.     set to   = Begin
  342.     set from = Begin
  343. ;
  344. ;  Assume all is well.
  345. ;
  346.     set CommonStatus = STATUS_SUCCESSFUL
  347.  
  348.     EndWait
  349.  
  350. ;
  351. ;   Set up the operation-mode-based variables and gaily welcome
  352. ;   the user.  If the "install mode" variable is improperly set,
  353. ;   assume this is a new installation.
  354. ;
  355.  
  356. Begin = +
  357.  
  358.     Ifstr(i) $(!NTN_InstallMode) == deinstall
  359.                 set StartLabel = removeadapter
  360.     else-Ifstr(i) $(!NTN_InstallMode) == Update
  361.                 set StartLabel = UpgradeSoftware
  362.     else-Ifstr(i) $(!NTN_InstallMode) == bind
  363.                 set StartLabel = bindingadapter
  364.     else-Ifstr(i) $(!NTN_InstallMode) == configure
  365.                 set StartLabel = configureadapter
  366.     else
  367.                 set StartLabel = installadapter
  368.                 set OEM_ABANDON_OPTIONS = {}
  369.                 set OEM_ABANDON_SOFTWARE = FALSE
  370.                 set OEM_ABANDON_ON = TRUE
  371.     endif
  372.  
  373.  
  374.     Set IRQValue = *($(IRQList),2)
  375.     Set IOBaseAddrValue = *($(IOBaseAddrValues),1)
  376.  
  377.     set from = $(fatal)
  378.     set to = $(fatal)
  379.     goto $(StartLabel)
  380.  
  381. ;-----------------------------------------------
  382. ; Installation Section
  383. ;-----------------------------------------------
  384.  
  385. installadapter = +
  386.  
  387.     goto adapteroptions
  388.  
  389.  
  390. ;-----------------------------------------------
  391. ; Configuration Section
  392. ;-----------------------------------------------
  393. ;
  394. ;   Get the current values of all the parameters
  395. ;
  396. configureadapter = +
  397.     Ifstr $(KeyProduct) == $(KeyNull)
  398.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) KeyProduct
  399.         Ifstr $(KeyProduct) == $(KeyNull)
  400.             set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  401.             Debug-Output "Cannot find component product key"
  402.             goto fatalregistry
  403.         Endif
  404.     Endif
  405.  
  406.     Set AdapterNumber = ""
  407.  
  408.     ;
  409.     ; Get the other parameters;  they're attached to the service parameters key
  410.     ;
  411.     Debug-Output "OEMNADNX.INF: Shelling to FindService"
  412.     Shell $(UtilityInf) FindService, $(KeyProduct)
  413.     Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  414.         Debug-Output "OEMNADNX.INF: FindService shell failure"
  415.         Goto ShellCodeError
  416.     Endif
  417.     Ifstr(i) $($R0) != NO_ERROR
  418.         Debug-Output "OEMNADNX.INF: FindService Shell error: "$($R0)
  419.         Goto fatalregistry
  420.     endif
  421.  
  422.     set KeyParameters = $($R2)
  423.  
  424.     ;
  425.     ;  We don't need the services key, so close it.
  426.     ;
  427.     CloseRegKey $($R1)
  428.  
  429.     Ifstr $(KeyParameters) == $(KeyNull)
  430.         set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  431.         Debug-Output "Cannot find component service"
  432.         goto fatalregistry
  433.     endif
  434.  
  435.     set OldVersionExisted = $(TRUE)
  436.  
  437.     set ValueName = ""
  438.     set ValueData = ""
  439.     set ValueStr  = ""
  440.     set ValueList = {}
  441.  
  442.     ;
  443.     ; Get the old values
  444.     ;
  445.     EnumRegValue $(KeyParameters) ValueList
  446.  
  447.     ForListDo $(ValueList)
  448.  
  449.         set ValueItem = $($)
  450.         set ValueName = *($(ValueItem),1)
  451.         set ValueData = *($(ValueItem),4)
  452.         Ifstr(i) $(ValueName) == "InterruptNumber"
  453.             set IRQValue = $(ValueData)
  454.         else-ifstr(i) $(ValueName) == "IoBaseAddress"
  455.             set IOBaseAddrValue = $(ValueData)
  456.         endif
  457.  
  458.     EndForListDo
  459.  
  460.     ifstr(i) $(IRQValue) == ""
  461.         set IRQValue = *($(IRQList), 2)
  462.     endif
  463.  
  464.     ifstr(i) $(IOBaseAddrValue) == ""
  465.         set IOBaseAddrValue = *($(IOBaseAddrDecList), 1)
  466.     endif
  467. ;
  468. ;  Read the symbolic link to the ODI entry from the "OdiLoadName" value
  469. ;
  470.     GetRegValue $(KeyParameters),"OdiLoadName", CardInstanceList
  471.     Set CardInstanceName = *($(CardInstanceList),4)
  472.  
  473. adaptersetup =+
  474.  
  475.     goto adapteroptions
  476. ;
  477. ;   Let the user bang on the options until satisfied.
  478. ;
  479. adapteroptions = +
  480.     set from = adapteroptions
  481.  
  482.     set IOBaseAddress = *($(IOBaseAddrHexList), ~($(IOBaseAddrDecList),+
  483.         $(IOBaseAddrValue)))
  484.  
  485.     read-syms FileDependentDlg$(!STF_LANGUAGE)
  486.  
  487.     ui start "InputDlg"
  488.  
  489.     ifstr(i) $(DLGEVENT) == "CONTINUE"
  490.         set IRQValue = $(Combo1Out)
  491.         set IOBaseAddress = $(Combo2Out)
  492.         ui pop 1
  493.     else-ifstr(i) $(DLGEVENT) == "BACK"
  494.         set CommonStatus = STATUS_USERCANCEL
  495.         Debug-Output "Action: exit. Bye."
  496.         ui pop 1
  497.         goto end
  498.     else
  499.         ;
  500.         ; Unknow command
  501.         ;
  502.         ui pop 1
  503.         Debug-Output "Action: unknown. Bye."
  504.         goto end
  505.     endif
  506.  
  507.     set IOBaseAddrValue = *($(IOBaseAddrDecList), ~($(IOBaseAddrHexList),+
  508.         $(IOBaseAddress)))
  509. ;
  510. ;   If installing, go create the necessary keys;
  511. ;   if configuring, they're already open.
  512. ;
  513.     ifint $(OldVersionExisted) == $(TRUE)
  514.         ifstr(i) $(!NTN_InstallMode) == configure
  515.             goto writeparameters
  516.         endif
  517.     endif
  518.  
  519.     StartWait
  520. ;
  521. ;   Create the HARDWARE\Netcard region and its corresponding service
  522. ;
  523.     Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
  524.  
  525.     ifint $($R4) != -1
  526.         Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
  527.     endif
  528.  
  529.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  530.         Debug-Output "Cannot add hardware component"
  531.         goto ShellCodeError
  532.     endif
  533.  
  534.     set RegistryErrorIndex = $($R0)
  535.  
  536.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  537.         EndWait
  538.         Debug-Output "Registry error: add hardware component"
  539.         CloseRegKey $($R1)
  540.         CloseRegKey $($R2)
  541.         CloseRegKey $($R3)
  542.         goto fatalregistry
  543.     endif
  544.  
  545. ;
  546. ;   At this point:
  547. ;     $R1  Registry key variable for HARDWARE\Netcard\(n)
  548. ;     $R2  Registry key variable for HARDWARE\Netcard\(n)\\NetRules
  549. ;     $R3  Registry key handle for <service>\Parameters key
  550. ;     $R4  Adapter number assigned to adapter
  551. ;     $R5  Service name generated by combining svc name with adapter number
  552. ;
  553.     set KeyParameters = $($R3)
  554.     set KeyAdapterRules = $($R2)
  555.     set AdapterNumber = $($R4)
  556.  
  557.     Set-add TempAdapterNumber = $(AdapterNumber),0
  558.  
  559.     set CardInstanceName = $(ProductHardwareName)" #"$(TempAdapterNumber)
  560.  
  561.     set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  562.                        {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardware$(Option)Title)},+
  563.                        {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardware$(Option)Description)},+
  564.                        {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  565.                        {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  566.                        {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  567.  
  568.     Debug-Output "AddValueList: $R1 = "$($R1)
  569.     Shell  $(UtilityInf), AddValueList, $($R1), $(NewValueList)
  570.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  571.         Debug-Output "ShellCode error"
  572.         goto ShellCodeError
  573.     endif
  574.  
  575.     CloseRegKey $($R1)
  576.  
  577.     set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  578.     set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  579.  
  580.     set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  581.                         {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  582.                         {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  583.  
  584.     Shell  $(UtilityInf), AddValueList, $(KeyAdapterRules), $(NewValueList)
  585.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  586.         Debug-Output "ShellCode error."
  587.         goto ShellCodeError
  588.     endif
  589.  
  590.     set RegistryErrorIndex = $($R0)
  591.  
  592.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  593.         EndWait
  594.         Debug-Output "Resgitry error: add value list."
  595.         CloseRegKey $(KeyParameters)
  596.         CloseRegKey $(KeyAdapterRules)
  597.         goto fatalregistry
  598.     endif
  599.  
  600.     CloseRegKey $(KeyAdapterRules)
  601.  
  602.     SetRegValue $(KeyParameters) {OdiLoadName,$(NoTitle),$(!REG_VT_SZ),$(CardInstanceName)}
  603.  
  604.     goto writeparameters
  605. ;
  606. ;   REQUIRED:   $(KeyParameters) contains service Parameters key handle
  607. ;
  608. writeparameters = +
  609.     Shell $(UtilityInf), GetBusTypeNum
  610.     set BusTypeNum = $($R1)
  611.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  612.         Debug-Output "ShellCode error."
  613.         goto ShellCodeError
  614.     endif
  615. ;
  616. ;   Add the rest of the parameters to the Services area
  617. ;
  618.     set NewValueList = {{InterruptNumber,$(NoTitle),$(!REG_VT_DWORD),$(IRQValue)},+
  619.                        {BusType,$(NoTitle),$(!REG_VT_DWORD),$(BusTypeNum)},+
  620.                        {MediaType,$(NoTitle),$(!REG_VT_DWORD),1},+
  621.                        {IoBaseAddress,$(NoTitle),$(!REG_VT_DWORD),$(IOBaseAddrValue)}}
  622.  
  623.     Shell  $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
  624.  
  625.     CloseRegKey $(KeyParameters)
  626.  
  627.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  628.         Debug-Output "ShellCode error."
  629.         goto ShellCodeError
  630.     endif
  631.  
  632.     set RegistryErrorIndex = $($R0)
  633.  
  634.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  635.         Debug-Output "Registry error: Add value list"
  636.         goto fatalregistry
  637.     endif
  638.  
  639. ;
  640. ; Check for NE2000 service, If found change start to 4 so it is not loaded
  641. ;
  642.     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(ProductHardwareName) $(MAXIMUM_ALLOWED) KeyNE2000
  643.     Ifstr(i) $(KeyNE2000) != $(KeyNull)
  644.         SetRegValue $(KeyNE2000) {Start,$(NoTitle),$(!REG_VT_DWORD),4}
  645.     Endif
  646.  
  647.     EndWait
  648.  
  649. ;
  650. ;  TRAVIS: Put the ODILOAD update info here!
  651. ;
  652.     Debug-Output "Add ODILOAD Parameters"
  653.  
  654.     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\OdiLoad" $(MAXIMUM_ALLOWED) KeyOdiLoad
  655.     Ifstr $(KeyOdiLoad) == $(KeyNull)
  656.         set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  657.         Debug-Output "Cannot find OdiLoad "
  658.         goto fatalregistry
  659.     Endif
  660.  
  661.     Set KeyOdiCard = $(KeyNull)
  662.     Debug-Output "CardInstanceName = "$(CardInstanceName)
  663.  
  664.     set CloseOdiModules = ""
  665.  
  666.     Ifstr(i) $(AdapterNumber) != ""
  667.         ;  This adapter was just installed; allow creation of the #nn key
  668.     CreateRegKey $(KeyOdiLoad) {$(OdiModules),$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyOdiModules
  669.     Ifstr(i) $(KeyOdiModules) == $(KeyNull)
  670.         OpenRegKey $(KeyOdiLoad) "" $(OdiModules) $(MAXIMUM_ALLOWED) KeyOdiModules
  671.         Ifstr(i) $(KeyOdiLoad) == $(KeyNull)
  672.             set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  673.         Debug-Output "Cannot find OdiLoad\"$(OdiModules)
  674.             goto fatalregistry
  675.         Endif
  676.     Endif
  677.     set CloseOdiModules = "1"
  678.         CreateRegKey $(KeyOdiModules) {$(CardInstanceName),$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyOdiCard
  679.     Endif
  680.  
  681.     Ifstr(i) $(KeyOdiCard) == $(KeyNull)
  682.         ;
  683.         ;  This is either an old card, or a prior version of the key existed.
  684.         ;
  685.     OpenRegKey $(KeyOdiLoad) "" $(OdiModules)\$(CardInstanceName) $(MAXIMUM_ALLOWED) KeyOdiCard
  686.     Ifstr(i) $(KeyOdiCard) == $(KeyNull)
  687.             set RegistryErrorIndex = CANNOT_FIND_COMPONEXT_SERVICE
  688.         Debug-Output "Can't create ODILOAD\"$(CardInstanceName)
  689.         goto fatalresistry
  690.     Endif
  691.     Endif
  692.  
  693.     set IOBaseAddressNw = *($(IOBaseAddrNwList), ~($(IOBaseAddrHexList),+
  694.         $(IOBaseAddress)))
  695.  
  696.     Debug-Output "OEMNADXN.INF: IOBaseAddress = "$(IOBaseAddress)
  697.  
  698.     set OdiParmList = {"Frame ETHERNET_802.3", +
  699.                "Frame ETHERNET_802.2", +
  700.                "Frame ETHERNET_II", +
  701.                "Frame ETHERNET_SNAP", +
  702.                "Port "$(IOBaseAddressNw), +
  703.                "Int "$(IRQValue)}
  704.     SetRegValue $(KeyOdiCard) {"Parameters",$(NoTitle),$(!REG_VT_MULTI_SZ),$(OdiParmList)}
  705.  
  706.     CloseRegKey $(KeyOdiLoad)
  707.     Ifstr(i) $(CloseOdiModules) != $(KeyNull)
  708.         CloseRegKey $(KeyOdiModules)
  709.     Endif
  710.     CloseRegKey $(KeyOdiCard)
  711.  
  712. ;
  713. ; Update the card name in IpxSpxII to be the last card installed
  714. ;
  715.     set IpxParameters = $(!NTN_ServiceBase)"\IpxSpxII\Parameters"
  716.     OpenRegKey $(!REG_H_LOCAL) "" $(IpxParameters) $(MAXIMUM_ALLOWED) KeyIpxParameters
  717.     Ifstr(i) $(KeyIpxParameters) == ""
  718.         Debug-Output "OEMNADNC.INF: Can't update IpxSpxII CardName"
  719.     Else
  720.         Split-String $(CardInstanceName) " " CardNameParts
  721.     set CardNameBase = *($(CardNameParts),1)
  722.         SetRegValue $(KeyIpxParameters) {"CardName",$(NoTitle),$(!REG_VT_SZ),$(CardNameBase)}
  723.     CloseRegKey $(KeyIpxParameters)
  724.     Endif
  725.  
  726.     goto successful
  727.  
  728. ;-----------------------------------------------
  729. ; Binding section
  730. ;-----------------------------------------------
  731. bindingadapter =+
  732.     set Error = "Binding: Sorry, not yet implemented."
  733.     goto fatal
  734.  
  735. ;-----------------------------------------------
  736. ; Removeadapter section
  737. ;-----------------------------------------------
  738.  
  739. removeadapter = +
  740. ;
  741. ;  TRAVIS: Put the ODILOAD adapter removal stuff here!
  742. ;
  743.  
  744. ;
  745. ; Delete the Services\OdiLoad\Odi_Modules\xxxxxx #01 card instance.
  746. ;
  747.     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) KeyParameters
  748.     Ifstr(i) $(KeyParameters) == ""
  749.  
  750.         Debug-Output "OEMNADNC.INF: removeadapter, Can't open "$(!NTN_RegBase)
  751.  
  752.     Else
  753.  
  754.         GetRegValue $(KeyParameters),"ServiceName", ServiceNameList
  755.         Set ServiceName = *($(ServiceNameList),4)
  756.         CloseRegKey $(KeyParameters)
  757.  
  758.  
  759.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(ServiceName)"\Parameters" $(MAXIMUM_ALLOWED) KeyService
  760.     ifstr(i) $(KeyService) == ""
  761.  
  762.         Debug-Output "OEMNADNC.INF: removeadapter, Can't open "$(ServiceName)
  763.  
  764.     Else
  765.         GetRegValue $(KeyService),"OdiLoadName", CardInstanceList
  766.         Set CardInstanceName = *($(CardInstanceList),4)
  767.         CloseRegKey $(KeyService)
  768.  
  769.         Set OdiModuleName = $(!NTN_ServiceBase)"\"$(DriverName)"\"$(OdiModules)
  770.             OpenRegKey $(!REG_H_LOCAL) "" $(OdiModuleName) $(MAXIMUM_ALLOWED) KeyOdiModules
  771.             Ifstr(i) $(KeyOdiModules) == ""
  772.  
  773.                 Debug-Output "OEMNADNC.INF: removeadapter, Can't open "$(OdiModulesName)
  774.  
  775.             Else
  776.                 Debug-Output "OEMNADNC.INF: Deleting card "$(CardInstanceName)
  777.         Debug-Output "OEMNADNC.INF: From Key "$(OdiModuleName)
  778.  
  779.                 DeleteRegTree $(KeyOdiModules) $(CardInstanceName)
  780.  
  781.         FlushRegKey $(KeyOdiModules)
  782.         CloseRegKey $(KeyOdiModules)
  783.  
  784.             Endif
  785.     Endif
  786.  
  787.     Endif
  788.  
  789. ;
  790. ; Increment the OdiLoad reference count so OdiLoad is not removed as a
  791. ; service.
  792. ;
  793.  
  794.     Shell $(UtilityInf), IncrementRefCount, $(ProductKeyName)
  795.     Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  796.         Debug-Output "ShellCode error removeadapter"
  797.         goto ShellCodeError
  798.     Endif
  799.  
  800.     set RegistryErrorIndex = $($R0)
  801.  
  802.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  803.         goto fatalregistry
  804.     Endif
  805.  
  806.     Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  807.             $(DriverName), $(!NTN_RegBase)
  808.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  809.         Debug-Output "ShellCode error"
  810.         goto ShellCodeError
  811.     endif
  812.  
  813.     set RegistryErrorIndex = $($R0)
  814.  
  815.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  816.         goto fatalregistry
  817.     endif
  818.  
  819. ; Decrement the reference count so OdiLoad can be removed when all the
  820. ; ODI adapters have been removed.
  821. ;
  822.     Shell $(UtilityInf), DecrementRefCount, $(ProductKeyName)
  823.     Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  824.         Debug-Output "ShellCode error removeadapter"
  825.         goto ShellCodeError
  826.     Endif
  827.  
  828.     set RegistryErrorIndex = $($R0)
  829.  
  830.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  831.         goto fatalregistry
  832.     Endif
  833.  
  834.     goto end
  835.  
  836. ;-----------------------------------------------
  837. ; Upgrade Software section
  838. ;-----------------------------------------------
  839.  
  840. UpgradeSoftware = +
  841.     ;
  842.     ; upgrade/update hardware component
  843.     ; There is no different between upgrade and update for hardware
  844.     ; component
  845.     ;
  846.     ; 1. Get the Service Name
  847.     ; 2. Change the NetRule section if necessary
  848.     ;
  849.     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) +
  850.           $(MAXIMUM_ALLOWED) NetworkCardKey
  851.     Ifstr(i) $(NetworkCardKey) != $(KeyNull)
  852.         ;
  853.         ; Get Service name
  854.         ;
  855.         GetRegValue $(NetworkCardKey),"ServiceName", ServiceNameInfo
  856.         set ServiceName = *($(ServiceNameInfo), 4)
  857.  
  858.         ;
  859.         ; Change the NetRule if necessary
  860.         ;
  861.         OpenRegKey $(NetworkCardKey) "" "NetRules" +
  862.             $(MAXIMUM_ALLOWED) NetRuleKey
  863.         Ifstr(i) $(NetRuleKey) != $(KeyNull)
  864.             ;
  865.             ; Make the change....
  866.             ;
  867.         else
  868.             ;
  869.             ; Error, cannot open net rules key
  870.             ;
  871.             goto fatalregistry
  872.         endif
  873.  
  874.         CloseRegKey $(NetRules)
  875.         CloseRegKey $(NetworkCardKey)
  876.     else
  877.         ;
  878.         ; Error, cannot open network card key
  879.         ;
  880.         goto fatalregistry
  881.     endif
  882.     ;
  883.     ; 3. Change the service section of the hardware. i.e.,
  884.     ;    ParameterName change, value change, etc.
  885.     ;
  886.     OpenRegKey $(!REG_H_LOCAL) "" +
  887.           $(!NTN_ServiceBase)"\"$(ServiceName) +
  888.           $(MAXIMUM_ALLOWED) ServiceKey
  889.  
  890.     Ifstr(i) $(ServiceKey) != $(KeyNull)
  891.         ;
  892.         ; Get the ServiceKey to change the Start value
  893.         ; or Type value. Or open Parameters key to
  894.         ; change the hardware parameters if necessary.
  895.         ;
  896.         CloseRegKey $(ServiceKey)
  897.     else
  898.         ;
  899.         ; Error, cannot open network card key
  900.         ;
  901.         goto fatalregistry
  902.     endif
  903.  
  904.     goto end
  905.     ;
  906.     ; End of Upgrade Software
  907.     ;
  908.  
  909. ;
  910. ;  Escape hatches
  911. ;
  912. successful = +
  913.     goto end
  914.  
  915. abandon = +
  916.     ForListDo $(OEM_ABANDON_OPTIONS)
  917.         Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  918.             $(DriverName), $($)
  919.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  920.             Debug-Output "ShellCode error"
  921.             goto ShellCodeError
  922.         endif
  923.  
  924.         set RegistryErrorIndex = $($R0)
  925.  
  926.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  927.             goto fatalregistry
  928.         endif
  929.     EndForListDo
  930.  
  931.     goto end
  932.  
  933. ;
  934. ; warning display
  935. ;
  936. warning = +
  937.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  938.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  939.         goto ShellCodeError
  940.     endif
  941.     ifstr(i) $($R1) == "OK"
  942.         goto $(to)
  943.     else-ifstr(i) $($R1) == "CANCEL"
  944.         goto $(from)
  945.     else
  946.         goto "end"
  947.     endif
  948.  
  949.  
  950. ;
  951. ; non fatal error display
  952. ;
  953. nonfatalinfo = +
  954.     Set CommonStatus = STATUS_USERCANCEL
  955.     Set Severity = STATUS
  956.     goto nonfatalmsg
  957. nonfatal = +
  958.     Set Severity = NONFATAL
  959.     goto nonfatalmsg
  960. nonfatalmsg = +
  961.     ifstr(i) $(Error) == ""
  962.         Set Severity = NONFATAL
  963.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  964.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  965.             goto ShellCodeError
  966.         endif
  967.         set Error = $($R0)
  968.     endif
  969.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  970.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  971.         goto ShellCodeError
  972.     endif
  973.     ifstr(i) $($R1) == "OK"
  974.         goto $(from)
  975.     else
  976.         goto "end"
  977.     endif
  978.  
  979. ;
  980. ;  Registry is broken
  981. ;
  982. fatalregistry = +
  983.     Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  984.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  985.         goto ShellCodeError
  986.     endif
  987.     set Error = $($R0)
  988.     goto fatal
  989.  
  990. fataldetect = +
  991.     Shell $(UtilityInf),RegistryErrorString,CANNOT_DETECT
  992.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  993.         Debug-Output "ShellCode error: cannot get an error string."
  994.         goto ShellCodeError
  995.     endif
  996.     set Error = $($R0)
  997.     Goto fatal
  998. ;
  999. ; fatal error display
  1000. ;
  1001. fatal = +
  1002.     ifstr(i) $(Error) == ""
  1003.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1004.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1005.             goto ShellCodeError
  1006.         endif
  1007.         set Error = $($R0)
  1008.     endif
  1009.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  1010.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1011.         goto ShellCodeError
  1012.     endif
  1013.  
  1014.     goto setfailed
  1015.  
  1016. ;
  1017. ;  Shelling error
  1018. ;
  1019. ShellCodeError = +
  1020.     set DlgType      = "MessageBox"
  1021.     set STF_MB_TITLE = "Error: "$(FunctionTitle)
  1022.     set STF_MB_TEXT  = "Shell Code Error"
  1023.     set STF_MB_TYPE  = 1
  1024.     set STF_MB_ICON  = 3
  1025.     set STF_MB_DEF   = 1
  1026.     ui start "Error Message"
  1027.     goto setfailed
  1028.  
  1029. setfailed = +
  1030.     set CommonStatus = STATUS_FAILED
  1031.     ;
  1032.     ; if OEM_ABANDON_ON == TRUE, then remove the registry entries
  1033.     ;
  1034.     ifstr(i) $(OEM_ABANDON_ON) == TRUE
  1035.         set OEM_ABANDON_ON = FALSE
  1036.         goto abandon
  1037.     endif
  1038.     goto end
  1039.  
  1040. end = +
  1041.     goto term
  1042.  
  1043. term = +
  1044.  
  1045.     Return $(CommonStatus)
  1046.  
  1047. ;***************************************************************
  1048. ;  INSTALL SECTIONS
  1049. ;***************************************************************
  1050. [Install-Option]
  1051.     set STF_VITAL = ""
  1052.  
  1053.     ifstr(i) $(AddCopy) == "YES"
  1054.  
  1055.         ;
  1056.         ; Add the files to the copy list
  1057.         ;
  1058.         AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1059.  
  1060.     endif
  1061.  
  1062.     ifstr(i) $(DoCopy) == "YES"
  1063.  
  1064.        ;
  1065.        ; Copy files in the copy list
  1066.        ;
  1067.        set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1068.        CopyFilesInCopyList
  1069.  
  1070.     endif
  1071.  
  1072.     ifstr(i) $(DoConfig) == "YES"
  1073.         ;
  1074.         ; Add product to registry
  1075.         ;
  1076.  
  1077.         ;
  1078.         ; Finish up
  1079.     endif
  1080.  
  1081.     Exit
  1082.  
  1083. [Install-Update]
  1084.    set STF_VITAL        = ""
  1085.    set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
  1086.    ;set STF_VERSION     = "YES"
  1087.  
  1088.    AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1089.    AddSectionFilesToCopyList Files-Inf $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1090.  
  1091.    set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1092.    CopyFilesInCopyList
  1093.  
  1094.    exit
  1095.  
  1096. [Source Media Descriptions]
  1097.     1  = "Windows NT Setup Disk #1"  , TAGFILE = disk1
  1098.     2  = "Windows NT Setup CD-ROM Disk"  , TAGFILE = disk2
  1099.     99    = "LMHOST disk", TAGFILE = lmhosts
  1100. [ProductType]
  1101. STF_PRODUCT  = Winnt
  1102. STF_PLATFORM = I386
  1103. [Files-Inf]
  1104. 2,    oemsetup.inf,     SIZE=1000,    RENAME=$(!UG_Filename)
  1105. [Files-ODI_NE2000]
  1106. 2,ne2000.lan , SIZE=20000
  1107.  
  1108.  
  1109.